<template>
	<view class="pageqrcode">
		<view class="cont">
			<input class="input" type="text" placeholder="请输入推荐码" v-model="qrcode">
		</view>
		<view class="button" @click="save">
			保存
		</view>	
	</view>
</template>

<script>
import { goBack } from '../../common/common';

	export default{
		components:{
		
		},
		data() {
		 
			return {
				qrcode:"",
				imgUrl:this.imgUrl,
			}
		},
		computed: {
		      
		},
		onLoad() {
		
		},
		methods: {
			save(){
				let userInfo = this.$store.state.myUserInfo 
				userInfo.invitationCode = this.qrcode;
				if(!this.qrcode){
					uni.showToast({
						title:'请输入推荐码',
						icon:'none'
					})
					return
					
				}
				this.$http.SaveMemberInfo(userInfo).then(res => {
					if(res.code==0){
					this.goTo("/pages/index/index?page=my")
					}
				})
			}
		}
	}
</script>

<style lang="scss">
	
	.input{
		width: 660rpx;height: 120rpx;line-height: 120rpx;
		margin: 60rpx auto;background: #fff;border-radius: 16rpx;
		padding: 0 20rpx;
	}
	
</style>